package com.bms.cfcmms.model.system;

import com.bms.cfcmms.util.annotation.FieldDefine;
import com.bms.cfcmms.util.annotation.TableDefine;
import lombok.Data;
import org.springframework.jdbc.core.RowMapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.persistence.Column;

/**
 * Created by carl on 2016/4/12.
 */
@TableDefine(group = "系统设置",
        id = 9903, title = "部门", primaryKey = "departmentId",
        codeLevel = "2,2,2,2,2")
@Data
public class Department implements RowMapper, Serializable {

    @FieldDefine(title = "部门编号", number = 10)
    @Column(length = 10, nullable = false)
    private String departmentId;

    @FieldDefine(title = "部门名称", nameField = true, number = 20)
    @Column(length = 50, nullable = false)
    private String name;

    @FieldDefine(title = "部门简称", number = 30)
    @Column(length = 50)
    private String shortname;

    @Column(name = "departmentClassId")
    private String departmentClassId;

    @FieldDefine(title = "操作所有", number = 50)
    @Column(nullable = false)
    private Boolean isOperAll;

    @FieldDefine(title = "本级", number = 60)
    @Column(nullable = false)
    private Boolean isOperThisLevel;

    @FieldDefine(title = "职责范围", number = 110)
    private String effect;

    @FieldDefine(title = "管理权限", number = 120)
    private String preview;

    @FieldDefine(title = "负责人", number = 130)
    @Column(length = 10)
    private String fzr;

    @FieldDefine(title = "是否管理部门", number = 140)
    @Column(nullable = false)
    private Boolean isManage;

    @FieldDefine(title = "备注", number = 200)
    private String remark;

    @Override
    public Object mapRow(ResultSet resultSet, int index) throws SQLException {
        return null;
    }
}
